from sqlalchemy import Column, Integer, String, SmallInteger, Boolean
from sqlalchemy.dialects.mysql import INTEGER, TINYINT
from mooc.db.database import Base


class ProfileFields(Base):
    __tablename__ = "ims_profile_fields"

    id = Column(INTEGER(unsigned=True), primary_key=True)
    field = Column(String(255), nullable=False)
    available = Column(TINYINT(1), nullable=False)
    title = Column(String(255), nullable=False)
    description = Column(String(255), nullable=False)
    displayorder = Column(SmallInteger, nullable=False)
    required = Column(TINYINT(1), nullable=False)
    unchangeable = Column(TINYINT(1), nullable=False)
    showinregister = Column(TINYINT(1), nullable=False)
    field_length = Column(Integer, nullable=False)

    class Config:
         from_attributes = True